extends Control

# 大子移动
func _on_移动_pressed():
	ObjectManager.soundManager.play(SoundType.button_click)
	if !GameUtils.checkIsReadyAction() || !GameUtils.checkActionEnough(SpendData.COST_BIG_MOVE):
		return
	ObjectManager.gameManager.operationManager.changeOperationType(OperationType.地灵_move)
	visible = false
	ObjectManager.gameManager.ui.closeDesc()

func _on_抹平_pressed():
	ObjectManager.soundManager.play(SoundType.button_click)
	if !GameUtils.checkIsReadyAction() || !GameUtils.checkActionEnough(SpendData.COST_地灵_抹平):
		return
	ObjectManager.gameManager.operationManager.changeOperationType(OperationType.地灵_抹平)
	visible = false
	ObjectManager.gameManager.ui.closeDesc()

func _on_占据_pressed():
	ObjectManager.soundManager.play(SoundType.button_click)
	if !GameUtils.checkIsReadyAction() || !GameUtils.checkActionEnough(SpendData.COST_地灵_占据):
		return
	ObjectManager.gameManager.operationManager.changeOperationType(OperationType.地灵_占据)
	visible = false
	ObjectManager.gameManager.ui.closeDesc()

func _on_移动_mouse_entered():
	var ui = ObjectManager.gameManager.ui as UI
	ui.wantShowDesc("移动：消耗1点能量，移动到落点")

func _on_抹平_mouse_entered():
	var ui = ObjectManager.gameManager.ui as UI
	ui.wantShowDesc("抹平：消耗3点能量，移动到落点，将地形改为空地")

func _on_占据_mouse_entered():
	var ui = ObjectManager.gameManager.ui as UI
	ui.wantShowDesc("占据：消耗3点能量，占据水晶，并攻击其他地灵，占据后回合开始时获得3点行能量1点科技点")

func _on_mouse_exited():
	var ui = ObjectManager.gameManager.ui as UI
	ui.closeDesc()
